package main

import (
	"crypto/tls"
	"fmt"
	"io"
	"net/http"
	"os"
)

func main() {
	// 模拟浏览器
	response, err := http.Get("http://localhost:8888/help")
	// http.Head()
	if err != nil {
		fmt.Println(err)
		return
	}
	fmt.Println(response.Proto, response.StatusCode)
	io.Copy(os.Stdout, response.Body)

	request, _ := http.NewRequest("GET", "http://localhost:8888/home", nil)
	client := http.Client{
		Transport: &http.Transport{
			TLSClientConfig: &tls.Config{
				InsecureSkipVerify: true,
			},
		},
	}
	response, _ = client.Do(request)
	io.Copy(os.Stdout, response.Body)

}
